<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      #father {
        height: 200px;
        background-color: #ccc;
        width: 200px;
        overflow: scroll;
      }
    </style>
  </head>
  <div id="father">
    <div id="ccbc">
      <p>shiagh</p>
      <p>shiagh</p>
      <p>shiagh</p>
      <p>shiagh</p>
      <p>shiagh</p>
      <p>shiagh</p>
      <p>shiagh</p>
    </div>
  </div>
  <body>
    <script>
      let divbig = document.querySelector("#father");
      divbig.onscroll = function (e) {
        console.log(divbig.scrollTop);
      };
    </script>
  </body>
</html>
